import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/material.dart';

import 'action.dart';
import 'state.dart';

Widget buildView(
    BottomNavbarState state, Dispatch dispatch, ViewService viewService) {
  return BottomNavigationBar(
    currentIndex: state.activeIndex,
    items: [
      BottomNavigationBarItem(
        icon: Icon(Icons.home),
        title: Text('首页'),
      ),
      BottomNavigationBarItem(
        icon: Icon(Icons.person),
        title: Text('我的'),
      ),
    ],
    onTap: (activeIndex) =>
        dispatch(BottomNavbarActionCreator.onActive(activeIndex)),
  );
}
